package java_test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

public class ArrayCollections {
    public static void main(String[] args) {
        ArrayList<String> arrayList = new ArrayList<String>();
        arrayList.add("A");
        arrayList.add("B");
        arrayList.add("C");
        arrayList.add("D");
        arrayList.add("E");
        System.out.print(arrayList);
        Collections.reverse(arrayList);
        System.out.println(arrayList);
        System.out.print("");
        Integer[] numbers = {8, 2, 7, 1, 4, 9, 5};
        int max = (int) Collections.max(Arrays.asList(numbers));
        int min = (int) Collections.min(Arrays.asList(numbers));
        System.out.println(max);
        System.out.println(min);
    }
}
